Skip to content

fix: the socket in socket.ts#5494

Closed
orbisai0security wants to merge 1 commit into
socketio:mainfrom
orbisai0security:fix-v007-max-connections-rate-limiting
Closed

fix: the socket in socket.ts#5494
orbisai0security wants to merge 1 commit into
socketio:mainfrom
orbisai0security:fix-v007-max-connections-rate-limiting

Conversation

@orbisai0security

Copy link
Copy Markdown

Summary

Fix high severity security issue in packages/engine.io/lib/socket.ts.

Vulnerability

Field Value
ID V-007
Severity HIGH
Scanner multi_agent_ai
Rule V-007
File packages/engine.io/lib/socket.ts:1

Description: The Socket.IO server accepts incoming connections without any rate limiting or connection throttling. There is no IP-based connection limit, no per-second connection rate cap, and no maximum concurrent connection enforcement. An attacker with a basic script can open thousands of simultaneous connections, each consuming server memory, file descriptors, and CPU for WebSocket handshake processing, until the server becomes unresponsive to legitimate users.

Changes

  • packages/engine.io/lib/server.ts

Verification

  • Build passes
  • Scanner re-scan confirms fix
  • LLM code review passed

Automated security fix by OrbisAI Security

Automated security fix generated by Orbis Security AI
@darrachequesne

Copy link
Copy Markdown
Member

Thanks for your report 👍

However, I think this can already be handled with the existing middleware mechanism, where users can enforce whatever policy fits their deployment: IP-based limits, connection-rate throttling, maximum concurrent handshakes, allow/deny lists, integration with Redis/shared counters, etc.

Reference: https://socket.io/docs/v4/middlewares/

Because these requirements vary significantly between deployments and infrastructure setups, adding another built-in Socket.IO/Engine.IO option would duplicate functionality that middleware already provides and would likely be too opinionated. Users who need this protection can plug in a middleware-based rate limiter or connection limiter at the handshake/request layer.

Thanks.

@orbisai0security

Copy link
Copy Markdown
Author

Thanks for the clear explanation. That makes sense. This is better handled as a deployment policy through middleware rather than as a built-in Engine.IO option, especially for multi-node deployments where a local counter would not be sufficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants